-
Notifications
You must be signed in to change notification settings - Fork 336
feat!: message composer attachment manager integration and improve send flow #3093
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
khushal87
wants to merge
166
commits into
V8
Choose a base branch
from
attachment-manager-integration
base: V8
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
+4,284
−5,624
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
* feat: remove StreamChatGenerics and introduce interface merging * fix: some of the outstanding todos * chore: add default interfaces * chore: remove SCG from sample app * fix: remove redundant types * fix: remove type module * fix: change the way interface declaration is consumed * fix: ignore ts complaints for interface declaration * chore: migrate TypescriptMessagingApp away from SCG * chore: migrate the Expo sample app away from SCG * fix: commit missing files * fix: revert mistaken change * fix: add resolutions for symlinked libs
BREAKING CHANGE: Release V7
* feat: introduce support for expo-video * fix: remove redundant test * fix: add check for audio component
# Conflicts: # .github/workflows/sample-distribution.yml # package/src/components/ChannelPreview/hooks/useChannelPreviewDisplayPresence.ts # package/src/components/ChannelPreview/hooks/useIsChannelMuted.ts # package/src/components/ChannelPreview/hooks/useLatestMessagePreview.ts # package/src/hooks/useTranslatedMessage.ts
# Conflicts: # examples/ExpoMessaging/yarn.lock # examples/SampleApp/ios/Podfile.lock # examples/SampleApp/yarn.lock # examples/TypeScriptMessaging/yarn.lock # package/expo-package/yarn.lock # package/native-package/yarn.lock # package/src/components/ChannelList/hooks/listeners/useUserPresence.ts # package/src/components/ChannelPreview/hooks/useChannelPreviewDisplayPresence.ts # package/src/hooks/useSelectedChannelState.ts
# Conflicts: # package/expo-package/package.json # package/expo-package/yarn.lock # package/native-package/package.json # package/native-package/yarn.lock # package/src/components/ImageGallery/__tests__/ImageGalleryFooter.test.tsx # package/src/components/ImageGallery/components/AnimatedGalleryVideo.tsx # package/src/components/Message/Message.tsx # package/src/components/Message/MessageSimple/MessageSimple.tsx # package/src/components/Message/MessageSimple/MessageStatus.tsx # package/src/components/Message/hooks/useMessageActionHandlers.ts # package/src/components/MessageMenu/MessageReactionPicker.tsx # package/src/contexts/messageInputContext/__tests__/pickFile.test.tsx # package/src/contexts/messagesContext/MessagesContext.tsx
* perf: abstract away composer api and usage * fix: remove props inport and remove comments --------- Co-authored-by: Khushal Agarwal <khushal.agarwal987@gmail.com>
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
The primary goal of the PR is to use the attachment manager from the new message composer in the LLC to manage the state of the files/image uploads and improve the overall sending flow of a message that respects the
LocalMessage
,Message
and thesendOptions
. The edit flow is also improved by relying on theLocalMessage
in the PR. The LLC does the heavy lifting that we used to do in the SDK, so it's good to have a single source of truth in the SDK.The following are the changes in the PR:
attachmentManager.uploadFiles
from the message composer to attach a file.attachments
returned from the state of the attachment manager which means we can get rid of theimageUploads
,fileUploads
,setFileUploads
,setimageUploads
completely from the state and the context and the composer can be used for the same.maxNumberOfFiles
is now directly set to the composer, and the uploads are respected by checking theavailableUploadSlots
in the state of the attachment manager directly.sendAsyncImage
prop is removed, and the uploads of images through that medium are no longer supported within the SDK. This is in parity with all other SDKs, and we don't see customers using that as it was buggy, and we haven't received any bug reports for a long time. This has been decided upon based on internal discussion within the team.doDocUploadRequest
and thedoImageUploadRequest
are now unified to a single function,doFileUploadRequest
, that handles all types of attachment uploads. This respects theUploadRequestFn
type from the SDK.AudioAttachmentUploadPreview
,FileAttachmentUploadPreview
,ImageAttachmentUploadPreview
,VideoAttachmentUploadPreview
. This makes things a lot customizable and easier to customise. In the future, we can easily extend it toUnsuportedAttachmentPreview
.UploadUnsupportedIndicator
is renamed toAttachmentUnsupportedIndicator
as it makes more sense.UploadProgressIndicator
is renamed toAttachmentUploadProgressIndicator
as it makes more sense.DismissUpload
is renamed toDismissAttachmentUpload
and pretty much unified to be used everywhere in the upload previews.InputEditingStateHeader
andInputReplyStateHeader
now respects the message composer logic.attachmentManager.uploadAttachment
function.asyncIds
,asyncUploads
,imageUploads
,fileUploads
,setFileUploads
,setimageUploads
,isValidMessage
,numberOfUploads
,setNumberOfUploads
,removeFile
,removeImage
,sendMessageAsync
,setAsyncIds
,setAsyncUploads
,updateMessage
,uploadNewImage
,uploadFile
,uploadImage
are removed from theMessageInputContext
henceforth. All of these can be handled using the message composer, and the flow is a lot simplified.autoCompleteSuggestionsLimit
,initialValue
,mentionAllAppUsersEnabled
and thementionAllAppUsersQuery
have been removed in favour of customizability through the middleware.editMessage
type is changed in theChannel
component, and theMessageInputProvider
calls the same with this signature:The
sendMessage
type is changed to: